<!--
 * @Description: 面板组件
 * @Version: 2.0
 * @Autor: Seven
 * @Date: 2020-12-01 17:23:37
 * @LastEditors: Seven
 * @LastEditTime: 2020-12-07 13:24:57
-->
<template>
    <div class="bar-wrap" :class="isFull ? 'Full' : ''">
        <div class="bar-title" v-if="title">
            <div class="title-wrap">
                <div class="left" :class="titleSize">
                    <span class="icon" v-if="icon"></span>
                    <span
                        class="s"
                        :style="titleColor ? `color:${titleColor}` : ''"
                        >{{ title }}</span
                    >
                </div>
            </div>
        </div>
        <div class="bar-body">
            <slot></slot>
        </div>
    </div>
</template>
<script>
export default {
    props: {
        title: {
            type: String,
            default: "",
        },
        // 是否显示左侧图标
        icon: {
            type: Boolean,
            default: false,
        },
        // 标题的尺寸
        titleSize: {
            type: String,
            default: "min",
        },
        // 标题的颜色
        titleColor: {
            type: String,
            default: "",
        },
        // 是否没有padding及背景
        isFull: {
            type: Boolean,
            default: false,
        },
    },
};
</script>
<style lang="scss" scoped>
.bar-wrap {
    background-color: #ffffff;
    box-shadow: 0px 3px 6px rgba(153, 153, 153, 0.1);
    text-align: left;
    &.Full {
        background-color: transparent;
        box-shadow: none;
        .bar-body {
            padding: 0;
        }
        .bar-title {
            padding: 20px 0;
        }
    }
    .bar-body {
        padding: 0 20px 20px 20px;
    }
}
.bar-title {
    padding: 20px;
    .title-wrap {
        .left {
            font-size: 16px;
            color: #333333;
            font-weight: 600;
            display: flex;
            align-items: center;
            &.max {
                font-size: 24px;
                .icon {
                    height: 22px;
                }
            }
            .icon {
                width: 4px;
                height: 17px;
                background-color: $--color-primary;
                display: inline-block;
                margin-right: 10px;
                vertical-align: middle;
            }
            .s {
                vertical-align: middle;
            }
        }
    }
}

@media screen and (max-width: 760px) {
    .bar-title {
        padding: 15px 10px;
    }
    .bar-body {
        padding: 0 10px 10px 10px;
    }
}
</style>